﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Effects.Effects.GuiParts
{
    // class representing Event Arguments for
    /// <summary>
    ///  Event arguments for Pot's Value Changed event (<see cref="E:Pot.ValueChanged"/>. 
    /// </summary>
    public class PotValueChangedEventArgs : EventArgs
    {
        /// <summary>
        ///  Value of potentiometer after the change
        /// </summary>
        private int newValueInt;
        /// <summary>
        ///  Gets the value of potentiometer that have been set after the change
        /// </summary>
        public int NewValueInt
        {
            get { return newValueInt; }
        }

        /// <summary>
        ///  Value of potentiometer after the changed stored as double
        /// </summary>
        private double newValue;
        /// <summary>
        ///  Gets the value of potentiometer that have been set after the change as double
        /// </summary>
        public double NewValue
        {
            get { return newValue; }
        }

        /// <summary>
        ///  Constructor - integer
        /// </summary>
        /// <param name="newValue"> value after the change </param>
        public PotValueChangedEventArgs(int newValue)
        {
            this.newValueInt = newValue;
            this.newValue = newValue;
        }

        /// <summary>
        ///  Constructor - double
        /// </summary>
        /// <param name="newValue"> value after the change </param>
        public PotValueChangedEventArgs(double newValue)
        {
            this.newValue = newValue;
            this.newValueInt = Convert.ToInt32(newValue);
        }
    }

    /// <summary>
    ///  Delegate for PotValueChanged event handlers.
    /// </summary>
    /// <param name="sender"> object that raises the event </param>
    /// <param name="e"> Event arguments </param>
    public delegate void PotValueChangedEventHandler(object sender, PotValueChangedEventArgs e);
}
